package com.bw.feignclient.service;

import com.bw.common.dto.UserDTO;
import com.bw.common.vo.UserVO;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class UserServiceFallBackFactory implements FallbackFactory<UserService> {
    @Override
    public UserService create(Throwable throwable) {
        throwable.printStackTrace();
        return new UserService() {
            @Override
            public UserVO getUserID(UserDTO userDTO) {
                log.info("/user/getUserID 出现异常......");
                return null;
            }
        };
    }
}
